#ifndef __SWM341_LIB_H__
#define __SWM341_LIB_H__

#include "SWM341Lib_Support.h"

#ifdef SUPPORT_SWM341_LIB_PORT
#include "SWM341_port.h"
#endif

#ifdef SUPPORT_SWM341_LIB_GPIO
#include "SWM341_gpio.h"
#endif

#ifdef SUPPORT_SWM341_LIB_EXTI
#include "SWM341_exti.h"
#endif

#ifdef SUPPORT_SWM341_LIB_TIMR
#include "SWM341_timr.h"
#endif

#ifdef SUPPORT_SWM341_LIB_UART
#include "SWM341_uart.h"
#endif

#ifdef SUPPORT_SWM341_LIB_SPI
#include "SWM341_spi.h"
#endif

#ifdef SUPPORT_SWM341_LIB_I2C
#include "SWM341_i2c.h"
#endif

#ifdef SUPPORT_SWM341_LIB_ADC
#include "SWM341_adc.h"
#endif

#ifdef SUPPORT_SWM341_LIB_PWM
#include "SWM341_pwm.h"
#endif

#ifdef SUPPORT_SWM341_LIB_DMA
#include "SWM341_dma.h"
#endif

#ifdef SUPPORT_SWM341_LIB_CAN
#include "SWM341_can.h"
#endif

#ifdef SUPPORT_SWM341_LIB_SDIO
#include "SWM341_sdio.h"
#endif

#ifdef SUPPORT_SWM341_LIB_SDRAM
#include "SWM341_sdram.h"
#endif

#ifdef SUPPORT_SWM341_LIB_FLASH
#include "SWM341_flash.h"
#endif

#ifdef SUPPORT_SWM341_LIB_LCD
#include "SWM341_lcd.h"
#endif

#ifdef SUPPORT_SWM341_LIB_SFC
#include "SWM341_sfc.h"
#endif

#ifdef SUPPORT_SWM341_LIB_DAC
#include "SWM341_dac.h"
#endif

#ifdef SUPPORT_SWM341_LIB_CORDIC
#include "SWM341_cordic.h"
#endif

#ifdef SUPPORT_SWM341_LIB_CRC
#include "SWM341_crc.h"
#endif

#ifdef SUPPORT_SWM341_LIB_DIV
#include "SWM341_div.h"
#endif

#ifdef SUPPORT_SWM341_LIB_RTC
#include "SWM341_rtc.h"
#endif

#ifdef SUPPORT_SWM341_LIB_WDT
#include "SWM341_wdt.h"
#endif

#ifdef SUPPORT_SWM341_LIB_QEI
#include "SWM341_qei.h"
#endif

#ifdef SUPPORT_SWM341_LIB_USB
#include "SWM341_usb.h"
#endif
  
#ifdef SUPPORT_SWM341_LIB_USBD
#include "SWM341_usbd.h"
#endif

#ifdef SUPPORT_SWM341_LIB_USBH
#include "SWM341_usbh.h"
#endif

#ifdef SUPPORT_SWM341_LIB_JPEG
#include "SWM341_jpeg.h"
#endif

#ifdef SUPPORT_SWM341_LIB_DMA2D
#include "SWM341_dma2d.h"
#endif

#ifdef SUPPORT_SWM341_LIB_IOFILT
#include "SWM341_iofilt.h"
#endif

#ifdef  SW_LOG_RTT
#define log_printf(...)	 	SEGGER_RTT_printf(0, __VA_ARGS__)
#else
#define log_printf(...)	 	printf(__VA_ARGS__)
#endif


#ifndef SW_LOG_LEVEL
#define SW_LOG_LEVEL        0
#endif

#if (SW_LOG_LEVEL > 0)
#define SW_LOG_ERR(...)    	{						 \
							log_printf("ERROR: ");   \
							log_printf(__VA_ARGS__); \
							log_printf("\n");		 \
							}

#if (SW_LOG_LEVEL > 1)
#define SW_LOG_WARN(...) 	{						 \
							log_printf("WARN : ");   \
							log_printf(__VA_ARGS__); \
							log_printf("\n");		 \
							}

#if (SW_LOG_LEVEL > 2)
#define SW_LOG_INFO(...)   	{						 \
							log_printf("INFO : ");   \
							log_printf(__VA_ARGS__); \
							log_printf("\n");		 \
							}
#else
#define SW_LOG_INFO(...)
#endif

#else
#define SW_LOG_WARN(...)
#define SW_LOG_INFO(...)
#endif

#else
#define SW_LOG_ERR(...)
#define SW_LOG_WARN(...)
#define SW_LOG_INFO(...)
#endif


#endif //__SWM341_LIB_H__
